from flask import Flask
from flask import render_template

app = Flask(__name__)


@app.route("/")
def books():
    result = """
    <ul>
        <li>首页</li>
        <li><a href="/ribendongman/">日本动漫</a></li>
        <li><a href="/guochandongman/">国产动漫</a></li>
        <li><a href="/meiguodongman/">美国动漫</a></li>
        <li><a href="http://www.yhdm.io/movie/">动漫电影</a></li>
    </ul>
    """
    return result


@app.route("/ribendongman/")
def xiaoriben():
    content = [
        {"movie_name": "死神来了之名侦探柯南", "author": "去哪哪死"},
        {"movie_name": "上海贼，王路飞", "author": " 有生之年不可能"},
        {"movie_name": "火影忍者", "author": " 回忆录"},
        {"movie_name": "overlord", "author": "骨傲天与空气争斗的生活"},
        {"movie_name": "一拳超人", "author": "战斗力仅次于蚊子和King的男人"},
    ]
    return render_template("book_page.html", **locals())


@app.route("/guochandongman/")
def guochanniubi():
    content = [
        {"movie_name": "穿书自救指南", "author": "主角穿越成配角分分钟归西"},
        {"movie_name": "尸兄", "author": " 光啊，不更了。。。"},
        {"movie_name": "全职高手", "author": " 满级大佬回新手村，重回巅峰"},
        {"movie_name": "虹猫蓝兔七侠传", "author": "因人物头发五颜六色被不知名家长举报，禁了"},
        {"movie_name": "雄兵连", "author": "3d国漫之最烂尾了"},
        {"movie_name": "魁拔", "author": "生错时代的动漫大电影"},
    ]
    return render_template("book_page.html", **locals())


@app.route("/meiguodongman/")
def meiguo():
    content = [
        {"movie_name": "咱们裸熊", "author": "三只熊"},
        {"movie_name": "蜘蛛侠", "author": " 吼吼"},
        {"movie_name": "成龙历险记", "author": " 好康！"},
        {"movie_name": "蜘蛛侠之平行宇宙", "author": "非彼得帕克的蜘蛛侠"},
        {"movie_name": "行尸走肉", "author": "没看过,我凑数的"},
    ]
    return render_template("book_page.html", **locals())


if __name__ == '__main__':
    app.run(
        host="127.0.0.1",
        port=3500,
        debug=True
    )
